home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 051-075 / disk_064 / readmes / readme.doc < prev   
Text File  |  1992-05-06  |  8KB  |  192 lines

  1.       Overview of IFF example source files
  2.             Feb. 4, 1986
  3.  
  4.  
  5. This source code is distributed as public domain software.
  6. Use it to help write robust IFF-compatible programs.
  7.  
  8. Caveat: Electronic Arts developed this code, and is releasing it to
  9. promote the success of the Amiga.  EA does not have the resources 
  10. to supply support for this code.
  11.  
  12. For support, Amiga software developers contact Commodore directly.
  13.  
  14.  
  15. 1. Files
  16.  
  17.    README  .DOC   This document.
  18.    BACKGRND.DOC   Tutorial on some techniques used in these example
  19.          programs.
  20.  
  21.    COMPILER.H   Portability file to isolate compiler idiosyncrasies.
  22.  
  23.    INTUALL .H   A super-include file for Amiga include files.
  24.  
  25.    REMALLOC.H   Header for RemAlloc subroutines.
  26.    REMALLOC.C   Memory ALLOCators which REMember the size allocated,
  27.          for simpler freeing.
  28.  
  29.    GIO     .H   Header file for Generic I/O speed up package.
  30.    GIO     .C   Generic I/O speed up routines (a disk cache).
  31.    GIOCALL .C   Outline of example GIO client.
  32.       To turn on the GIO package, change a switch in GIO.H,
  33.       add GIO.O to the linker control file, and recompile.
  34.  
  35.    IFF     .H     Header file for general IFF read/write support.
  36.    IFFR    .C     IFF reade support routines.
  37.    IFFW    .C     IFF writer support routines.
  38.       These routines do a lot of the work for reading and writing
  39.       IFF files robustly. The reader and writer are separate since
  40.       some programs don't need both.
  41.  
  42.    IFFCHECK.C     IFF checker utility source (very handy for debugging).
  43.    IFFCHECK.LNK   IFF checker utility linker control file.
  44.    IFFCHECK       Amiga runnable object program.
  45.       The IFF checker scans an IFF file, checks it for syntax
  46.       errors, and prints an outline of its contents.
  47.  
  48.    PACKER  .H     Header for byte run encoder (compressor) subroutines.
  49.    PACKER  .C     Run encoder subroutines.
  50.    UNPACKER.C     Run decoder subroutines.
  51.       This run encoder/decoder is used for ILBM raster images.
  52.  
  53.    ILBM    .H     Header for ILBM (raster image file) subroutines.
  54.    ILBMR   .C     ILBM reader support routines. Uses IFFR.
  55.    ILBMW   .C     ILBM writer support routines. Uses IFFW.
  56.  
  57.    READPICT.H   Header for ReadPicture subroutines.
  58.    READPICT.C   ReadPicture subroutines read an ILBM file into an
  59.          Amiga BitMap in RAM. Uses ILBMR and IFFR.
  60.  
  61.    SHOWILBM.C     Example program that reads and displays an ILBM file.
  62.    SHOWILBM.LNK   Linker control file for ShowILBM program.
  63.    SHOWILBM       Amiga runnable object program ShowILBM.
  64.    SHOWILBM.INFO   So you can run ShowILBM under the Amiga workbench.
  65.  
  66.    PUTPICT .H   Header for PutPict subroutines.
  67.    PUTPICT .C   PutPict subroutines write an Amiga BitMap from RAM
  68.          to an ILBM file. Uses ILBMW and IFFW.
  69.  
  70.    RAW2ILBM.C     Example program that reads a "raw" raster image file
  71.          and writes the image as an ILBM file.
  72.    RAW2ILBM.LNK   Linker control file for Raw2ILBM.
  73.    RAW2ILBM   Amiga runnable object program.
  74.  
  75.    ILBM2Raw.C     Example program that reads an image as an ILBM file
  76.          and writes the image as a "raw" raster image file.
  77.    ILBM2Raw.LNK   Linker control file for ILBM2Raw.
  78.    ILBM2Raw   Amiga runnable object program.
  79.  
  80.    BMPrintC.C   Subroutine that actually does the text dump.
  81.    ILBMDump.C     Example program that reads an image as an ILBM file
  82.          and writes the image as a text file containing
  83.          C data initialization statements for either a
  84.          BOB or a Sprite.
  85.    ILBMDump.LNK   Linker control file for ILBMDump.
  86.    ILBMDump   Amiga runnable object program.
  87.  
  88.    ZapIcon      Amiga runnable program that creates a tool icon from
  89.          an ILBM (i.e., a brush saved from DPaint).
  90.          Usage: zapicon brushname toolname
  91.  
  92.    IFFCHECG.LNK   Link file for IFFCheck including GIO.
  93.    SHOWILBG.LNK   Link file for ShowILBM including GIO.
  94.    RAW2ILBG.LNK   Link file for Raw2ILBM including GIO.
  95.  
  96.          -- All ".BAT" files are MS-DOS batch files --
  97.    COMPILE .BAT   Batch file to compile all the IFF source code.
  98.    LINK    .BAT   Batch file to link IFFCheck, ShowILBM, & Raw2ILBM.
  99.    LINKGIO .BAT   Batch file to link the 3 programs with GIO.
  100.  
  101.    SOURCE  .BAT   Batch file to copy/print/etc. all the source files.
  102.    NotSrc  .BAT   Batch file to copy/print/etc. all the other files.
  103.    RELEASE .BAT   Batch file to copy/print/etc. all the files.
  104.    AllIFFO .BAT   Combine iff primitives into one file alliff.o.
  105.  
  106.    startup .txt   Becomes s/Startup-Sequence on Amiga IFF disk.
  107.  
  108.    dragon      A picture of a dragon, in ILBM format.
  109.    dragon   .info   Amiga icon for dragon.
  110.    dragon   .c   Dragon as a BOB as C data statements, using ILBMDump.
  111.  
  112.    bird3to8.lo3   A picture containing frames # 3 thru 8 of a
  113.          flying eagle, in RAW format, low-resolution,
  114.          3-bitplanes.
  115.    bird0to2   Frames # 0 thru 2 of flying eagle.
  116.    bird0to2.info   Amiga icon.
  117.  
  118. 2. About the development environment.
  119.  
  120. This source code is built for the Lattice 68000 C cross-compiler from the
  121. IBM PC and the MetaComCo Amiga linker. You may have to make changes to suit
  122. other development tools, another development machine, or another target
  123. machine.
  124.  
  125. These programs use C header files supplied by Commodore for the Amiga
  126. computer. If you need them, contact Commodore. Dependencies on the runtime
  127. environment are pretty localized, so ports should be easy.
  128.  
  129.  
  130. If you don't have Commodore's EXEC/TYPES.H file, here are some global IFF
  131. definitions you'll need:
  132.  
  133. typedef long      LONG;       /* signed   32-bit number */
  134. typedef unsigned long   ULONG;       /* unsigned 32-bit number */
  135. typedef short      WORD;       /* signed   16-bit number */
  136. typedef unsigned short   UWORD;       /* unsigned 16-bit number */
  137. typedef char      BYTE;       /* signed    8-bit number */
  138. typedef unsigned char   UBYTE;       /* unsigned  8-bit number */
  139. typedef short      BOOL;
  140. #define NULL      0
  141.  
  142.  
  143. 3. Compiler ideosyncracies.
  144.  
  145. The Lattice C compiler running on the IBM PC supports a recent addition to
  146. the C language: the ability to typecheck procedure arguments (templates).
  147. Believe me, typechecking is useful! The more bugs I find at compile time,
  148. the less I have to find at run time.
  149.  
  150. The programmer asks for typechecking via an "extern" statement like this:
  151.    extern IFFP Seek(BPTR, LONG, LONG);
  152. or a "typedef" statement like this:
  153.    typedef IFFP ClientProc(struct _GroupContext *);
  154.  
  155. Unfortunately, this chokes other C compilers. If you have such a compiler,
  156. you have to comment out the stuff in parentheses. The above two examples
  157. become:
  158.    extern IFFP Seek(/* BPTR, LONG, LONG */);
  159. or a "typedef" statement like this:
  160.    typedef IFFP ClientProc(/* struct _GroupContext * */);
  161. Don't remove the parentheses!
  162.  
  163. The header file COMPILER.H defines macros to isolate the compiler
  164. dependencies. The macro FDwAT ("function definitions with argument
  165. types") switches on/off the argument type declarations in the header files
  166. in this directory.
  167.  
  168.  
  169. 4. RemAlloc subroutines.
  170.  
  171. The "REMembering ALLOCator" is a useful little subroutine package included
  172. here. It saves you from having to remember the size of each node you
  173. allocate. (Why doesn't the Amiga allocator do this?)
  174.  
  175.  
  176. 5. Optional buffered file I/O package GIO.
  177.  
  178. Amiga file I/O can be greatly sped up by use of a RAM buffer. So we now have
  179. a layer of software that provides optional buffering. The "option" is
  180. controlled by changing a "#define" inside the header file GIO.H, adding
  181. GIO.O to your link file, recompiling, and recompiling. When turned off,
  182. this layer becomes just a layer of macro calls between the IFFR and IFFW
  183. modules and the AmigaDOS routines they call.
  184.  
  185. This RAM buffer speeds things up when you're doing numerous small Writes
  186. and/or Seeks while writing. The general IFF writer IFFW.C tends to do this.
  187. It should be extended to optimize reading, too.
  188.  
  189. If you are not using IFF, and already Write in chunks of 256 bytes or more,
  190. don't bother using GIO.
  191.  
  192.